package com.enation.app.javashop.api.client;

import com.enation.app.javashop.model.base.SettingGroup;
import com.enation.app.javashop.service.base.service.SettingManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author fk
 * @version v2.0
 * @Description: 设置对外client
 * @date 2018/7/30 15:06
 * @since v7.0.0
 */
@RestController
@RequestMapping("/client/system/settings")
@Validated
@ApiIgnore
public class SettingClientController {


    @Autowired
    private SettingManager settingManager;

    @PostMapping
    public void save(@RequestParam("group") SettingGroup group, @RequestBody Object settings) {

        this.settingManager.save(group,settings);

    }

    @GetMapping
    public String get(@RequestParam("group") SettingGroup group) {

        return this.settingManager.get(group);
    }

}
